3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
8k + S, where k is the number of elements in the container and S is the sum of the sizes of those elements. (For each of the k elements, 4 bytes for the type ID and 4 bytes for the field that holds the element's size, plus the size of the element.)
A container is an ordered collection of objects. Containers are used to form complex objects from simpler objects in ways permitted by the structure of the metafile object hierarchy. In particular, child objects (also called subobjects ) are attached to parent objects (also called the root ) through the use of containers. The first object in a container is the parent (or root) object. Every container must contain at least one object. Containers may be nested. An object may be instantiated more than once in a hierarchy of nested containers.
The notation for containers in text metafiles is as follows:
Container (
object0
.
.
.
objectnobjects-1
)
Notations for contained objects are separated by blank spaces rather than by punctuation marks, as is the case in the notation for other objects having nonzero size.
The root object of a container must be a shared object, may not be a container itself, and may not be the target object of a file pointer. The position in the metafile object hierarchy of the root object of a container constrains the number, type, and in some cases the order of occurrence of other elements of that container. Each element of a container other than the root object must be either a legitimate child object of the root object or another container. In the latter case, the root object of the inner container must be a legitimate child object of the root object of the outer one.
3DMetafile ( 1 5 Normal tableofcontents0> )
box2:
Container (
Box (
0 0 1 # orientation
1 0 0 # majorAxis
0 0 0 # minorAxis
0 1 0 # origin
)
attributeset3:
Container (
AttributeSet ( )
DiffuseColor ( 0.9 0.9 0.2 )
)
)
Previous | QD3D Book | Overview | Chapter Contents | Next |